import fetch from '@/utils/request'
// import { getToken } from '@/utils/auth'
import { addParams } from './common.js'

// 按平台查询支付银行列表
export function queryBanklist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.dictionary.aggregation/bankSubs/getBankDtoByPlatform',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 查询所有银行列表
export function queryalllist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.dictionary.aggregation/bank/list',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 添加银行到平台银行列表
export function queryaddlist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.dictionary.aggregation/bankSubs/add',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 修改银行状态

export function queryupdlist(params) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.dictionary.aggregation/bankSubs/updateStatus',
    method: 'post',
    params: uploadParams
  })
}

// 删除银行
export function querydelist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.dictionary.aggregation/bankSubs/delete',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 拆单配置查询
export function querysplist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    // url: '/api/allinpay.balance.service/balance/getOrderSplitList',
    url: '/api/allinpay.balance.splitorder/splitOrder/listsplitConfig',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 拆单配置批量编辑
export function queryupsplist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.splitorder/splitOrder/updatelistsplitConfig',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 拆单配置历史记录
export function queryHistorysplist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.splitorder/splitOrder/listsplitConfigHistory',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 拆单配置新增
export function queryadsplist(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.splitorder/splitOrder/addsplitConfig',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 参数配置
export function queryConfig(params) {
  const uploadParams = addParams(params)
  return fetch({
    // baseURL: 'https://www.easy-mock.com/mock/5ab9d83305896018293276bf/bt',
    url: '/api/allinpay.balance.service/balance/getConfig',
    method: 'post',
    params: uploadParams
  })
}

// 参数配置 修改更新
export function updateConfig(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    // baseURL: 'https://www.easy-mock.com/mock/5ab9d83305896018293276bf/bt',
    url: '/api/allinpay.balance.service/balance/updateConfig',
    method: 'post',
    params: uploadParams,
    data: data
  })
}
// 资金池配置查询
export function querycapitalPool(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    // baseURL: '',
    // url: 'https://easy-mock.com/mock/5ab1def9a93c6716f0951b51/bt/split/list',
    url: '/api/allinpay.balance.channelconfig/channelcfg/getSpecialList',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 资金池配置新增
export function addcapitalPool(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/saveSpecial',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 资金池配置修改
export function upcapitalPool(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/updateSpecial',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 资金池配置新增渠道号
export function querychannelCd(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.organ.aggregation/organAggregation/specInfo/query',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 资金池配置处理记录查询
export function querycapitalRecord(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.channelconfig/channelcfg/querySpecialAll',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 渠道保证金配置新增
export function addchannelBond(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/saveBond',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道保证金配置修改
export function upchannelBond(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/updateBond',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道保证金配置查询
export function channelBond(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.channelconfig/channelcfg/getBondList',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道保证金配置处理记录查询
export function channelBondRecord(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.channelconfig/channelcfg/queryBondAll',
    method: 'post',
    data: data,
    params: uploadParams
  })
}

// 渠道价格配置新增
export function addchannelPrice(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/saveExpenses',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道价格配置修改
export function upchannelPrice(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    url: '/api/allinpay.balance.channelconfig/channelcfg/updateExpenses',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道价格配置查询
export function channelPrice(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.channelconfig/channelcfg/getExpensesList',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
// 渠道价格配置处理记录查询
export function channelPriceRecord(params, data) {
  const uploadParams = addParams(params)
  return fetch({
    baseURL: '',
    url: '/api/allinpay.balance.channelconfig/channelcfg/queryExpAll',
    method: 'post',
    data: data,
    params: uploadParams
  })
}
